-- Checks if the SQLite mode is activated or not --
if ( Hyperion.Schema.Configuration[ "SQLite_Mode" ] == true and Hyperion.Schema.Configuration[ "MySQL_Mode" ] == false ) then
	MsgN( "[Hyperion] SQLite Mode Activated" )
elseif ( Hyperion.Schema.Configuration[ "SQLite_Mode" ] == true and Hyperion.Schema.Configuration[ "MySQL_Mode" ] == true ) then
	MsgN( "[Hyperion] SQL Error: You can't use both MySQL and SQLite! Pick one!" )
end

-- Creates the SQLite tables --
function Hyperion.SQLite_CreateTables()
	if ( Hyperion.Schema.Configuration[ "SQLite_Mode" ] == false ) then
		return
	end

	if ( !sql.TableExists( "hyperion_users" ) ) then
		local query = "CREATE TABLE hyperion_users ( SteamID int(255), Name varchar(255) )"
		local result = sql.Query( query )

		if ( sql.TableExists( "hyperion_users" ) ) then
			MsgN( "[Hyperion] Table: 'hyperion_users' created" )
		else
			MsgN( "[Hyperion] SQL Error: " .. sql.LastError( result ) )
		end
	elseif ( !sql.TableExists( "hyperion_characters" ) ) then
		local query = "CREATE TABLE hyperion_characters ( SteamID int(255) )"
		local result = sql.Query( query )

		if ( sql.TableExists( "hyperion_characters" ) ) then
			MsgN( "[Hyperion] Table: 'hyperion_characters' created" )
		else
			MsgN( "[Hyperion] SQL Error: " .. sql.LastError( result ) )
		end
	end
end

-- Checks if the SQLite mode is activated or not, and if it is, it proceeds to call the function that creates the SQLite tables --
if ( Hyperion.Schema.Configuration[ "SQLite_Mode" ] == true and Hyperion.Schema.Configuration[ "MySQL_Mode" ] == false ) then
	Hyperion.SQLite_CreateTables()
end